<!--表输入-->
<template>
  <el-container style="height: 100%">
    <el-main class="body-warp pd0" style="height: 100%">
      <el-form :model="formData" label-width="90px" size="small">
        <el-form-item label="步骤名称:" prop="name">
          <el-input maxlength="40" v-model="formData.label"> </el-input>
        </el-form-item>
      </el-form>
    </el-main>
    <el-footer class="dialog-footer">
      <el-button @click="handleCancel">取 消</el-button>
      <el-button type="primary" @click="handleOk">确 定</el-button>
    </el-footer>
  </el-container>
</template>

<script>
export default {
  name: "TableInput",
  width: "450px",
  height: "400px",
  data() {
    return {
      title: "表输入",
      formData: {
        label: "" //描述
      }
    };
  },
  props: {
    cell: {
      type: Object,
      default: null
    }
  },
  methods: {
    //取消
    handleCancel() {
      this.$emit("close");
    },
    //确定
    handleOk() {
      //先进行数据校验

      //触发父组件保存事件
      this.$emit("save", this.formData);
    }
  },
  created() {
    //console.log(this.cell);
    this.formData.label = this.cell.getAttribute("label");
    //设置标题
    let tlx = this.title + "-" + this.formData.label;
    this.$emit("setTitle", tlx, this.cell["style"].split("=")[1]);
  }
};
</script>

<style scoped></style>
